package com.nuoniu.sibanyun.service.production.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nuoniu.sibanyun.entity.production.MaMrpDetail;
import com.nuoniu.sibanyun.entity.production.VProductionWorkDetail;
import com.nuoniu.sibanyun.mapper.production.MaMrpDatailMapper;
import com.nuoniu.sibanyun.service.production.IMaMrpDatailService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 物料需求计划明细表 服务实现类
 * </p>
 *
 * @author 小啊刚
 * @since 2023-05-22
 */
@Service
public class MaMrpDatailServiceImpl extends ServiceImpl<MaMrpDatailMapper, MaMrpDetail> implements IMaMrpDatailService {

    @Override
    public List<MaMrpDetail> getDetailByManId(Long id) {
        return lambdaQuery().eq(MaMrpDetail::getOrderId, id).list();
    }

    @Override
    public void updateReleasedQuantityReduce(Integer sourceDetailId, BigDecimal baseQuantity) {
        baseMapper.updateReleasedQuantityReduce(sourceDetailId, baseQuantity);
    }
}
